package jfinal42.model;

import java.util.List;

import com.jfinal.plugin.activerecord.Model;
//列名作为实体的属性（map） 列名作为key,值作为value
//map.key

public class News extends Model<News> {
	public static final News DAO = new News();

	public Category getCate() {
		// ->System.out.println(">>>>>>>>>>>>>>>>>>>");
		return Category.DAO.findById(super.getLong("cate_id"));
	}

	// 评论集合
	public List<Comment> getComments() {
		return Comment.DAO.find("select * from comment where news_id=?",
				super.getLong("id"));
	}
}
